1. Field of the Invention
The present application relates generally to an improved data processing apparatus and method and more specifically to an apparatus and method for performing a viral trace of the execution of a computer program.
2. Background of the Invention
In analyzing and enhancing performance of a data processing system and the applications executing within the data processing system, it is helpful to know which software modules within a data processing system are using system resources. Effective management and enhancement of data processing systems requires knowing how and when various system resources are being used. Performance tools are used to monitor and examine a data processing system to determine resource consumption as various software applications are executing within the data processing system. For example, a performance tool may identify the most frequently executed modules and instructions in a data processing system, or may identify those modules which allocate the largest amount of memory, or perform the most I/O requests. Hardware performance tools may be built into the system or added at a later point in time. Software performance tools also are useful in data processing systems, such as personal computer systems, which typically do not contain many, if any, built-in hardware performance tools.
One known software performance tool is a trace tool. A trace tool may use more than one technique to provide trace information that indicates execution flows for an executing program. One technique keeps track of particular sequences of instructions by logging certain events as they occur, so-called event-based profiling technique. For example, a trace tool may log every entry into, and every exit from, a module, subroutine, method, function, or system component. Typically, a time-stamped record is produced for each such event. Corresponding pairs of records similar to entry-exit records also are used to trace execution of arbitrary code segments, starting and completing I/O or data transmission, and for many other events of interest.
Typically, such trace tools utilize trace hooks. A trace hook is a small portion of code that causes the execution of the software to temporarily fork to a routine that gathers data regarding the execution of the software. For example, the trace hook may cause an exception to occur which is then handled by an exception handler which invokes a trace data gathering routine. The execution may then be returned to the original software execution stream following handling of the exception. The trace data, e.g., the log of events, etc., generated by such trace tools is provided to a user to provide a view of the execution history of the software. In this way, the user may debug the software so as to obtain a desired execution of the software on the computing device.